const mongoose = require('mongoose');

// 定义图书的 Schema
const bookSchema = new mongoose.Schema({
  title: {
    type: String,
    required: true,
  },
  author: {
    type: String,
    required: true,
  },
  isbn: {
    type: String,
    required: true,
    unique: true,
  },
});

// 创建并导出图书模型
module.exports = mongoose.model('Book', bookSchema);
